Platform Explorer / Nuxeo Platform LTS 2015 7.10

Contribution org.nuxeo.mail.automation.chains--chains

This contribution is part of XML component org.nuxeo.mail.automation.chains inside nuxeo-platform-mail-core-7.10.jar /OSGI-INF/automation-contrib.xml

Extension Point

Extension point chains of component OperationServiceComponent.

Contributed Items

  • <chain id="CreateMailDocumentFromAutomation">
          <operation id="Context.RestoreDocumentInput">
            <param name="name" type="string">mailFolder</param>
          </operation>
          <operation id="Document.Create">
            <param name="type" type="string">MailMessage</param>
            <param name="name" type="string">expr:Context["mailDocumentName"]</param>
            <param name="properties" type="properties">expr:mail:messageId=@{messageId}
            </param>
          </operation>
          <operation id="Context.SetInputAsVar">
            <param name="name" type="string">mailDocument</param>
          </operation>
          <operation id="Context.RunOperationOnList">
            <param name="id" type="string">ProcessAttachment</param>
            <param name="list" type="string">attachments</param>
            <param name="isolate" type="boolean">true</param>
            <param name="item" type="string">attachment</param>
          </operation>
          <operation id="RunScript">
            <param name="script" type="string">
               
               Context["mailDocument"].setPropertyValue("dc:title",Context["subject"]);
               Context["mailDocument"].setPropertyValue("mail:htmlText",Context["text"]);
               Context["mailDocument"].setPropertyValue("mail:recipients",Context["recipients"]);
               Context["mailDocument"].setPropertyValue("mail:cc_recipients",Context["ccRecipients"]);
               Context["mailDocument"].setPropertyValue("mail:sending_date",Context["sendingDate"]);
                  
            </param>
          </operation>
          <operation id="Context.RestoreDocumentInput">
            <param name="name" type="string">mailDocument</param>
          </operation>
          <operation id="Document.Save"/>
        </chain>
  • <chain id="ProcessAttachment">
          <operation id="Context.RestoreBlobInput">
            <param name="name" type="string">attachment</param>
          </operation>
          <operation id="Blob.AttachOnDocument">
            <param name="document" type="document">expr:Context["mailDocument"]</param>
            <param name="save" type="boolean">false</param>
            <param name="xpath" type="string">files:files</param>
          </operation>
        </chain>

XML Source

<extension point="chains" target="org.nuxeo.ecm.core.operation.OperationServiceComponent">
    <chain id="CreateMailDocumentFromAutomation">
      <operation id="Context.RestoreDocumentInput">
        <param name="name" type="string">mailFolder</param>
      </operation>
      <operation id="Document.Create">
        <param name="type" type="string">MailMessage</param>
        <param name="name" type="string">expr:Context["mailDocumentName"]</param>
        <param name="properties" type="properties">expr:mail:messageId=@{messageId}
        </param>
      </operation>
      <operation id="Context.SetInputAsVar">
        <param name="name" type="string">mailDocument</param>
      </operation>
      <operation id="Context.RunOperationOnList">
        <param name="id" type="string">ProcessAttachment</param>
        <param name="list" type="string">attachments</param>
        <param name="isolate" type="boolean">true</param>
        <param name="item" type="string">attachment</param>
      </operation>
      <operation id="RunScript">
        <param name="script" type="string">
           
           Context["mailDocument"].setPropertyValue("dc:title",Context["subject"]);
           Context["mailDocument"].setPropertyValue("mail:htmlText",Context["text"]);
           Context["mailDocument"].setPropertyValue("mail:recipients",Context["recipients"]);
           Context["mailDocument"].setPropertyValue("mail:cc_recipients",Context["ccRecipients"]);
           Context["mailDocument"].setPropertyValue("mail:sending_date",Context["sendingDate"]);
              
        </param>
      </operation>
      <operation id="Context.RestoreDocumentInput">
        <param name="name" type="string">mailDocument</param>
      </operation>
      <operation id="Document.Save"/>
    </chain>
    <chain id="ProcessAttachment">
      <operation id="Context.RestoreBlobInput">
        <param name="name" type="string">attachment</param>
      </operation>
      <operation id="Blob.AttachOnDocument">
        <param name="document" type="document">expr:Context["mailDocument"]</param>
        <param name="save" type="boolean">false</param>
        <param name="xpath" type="string">files:files</param>
      </operation>
    </chain>
  </extension>